package com.hbnu.expression;

import java.util.Scanner;

/**
 * @author kittychen
 * @since 2025-09-29 16:43
 */
public class Exception06 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int a = scanner.nextInt();

        int result = 0;
        try {
            result = method(a);
        } catch (NegetiveException e) {
            e.printStackTrace();
        }

        System.out.println(result);
    }

    private static int method(int a) throws NegetiveException {

        if (a < 0) {
            throw new NegetiveException("a不能为负数");
        }
        return  2 * a;
    }
}
